package com.bwie.controller;

import com.bwie.pojo.TbUser;
import com.bwie.service.TbUserService;
import com.bwie.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user/user")
public class TbUserController {
    @Autowired
    TbUserService tbUserService;

    @PostMapping("/TbUserList/{role}")
    public R TbUserList(@PathVariable String role) {
        return tbUserService.TbUserList(role);
    }
    @PostMapping("/sendCode/{mobile}")
    public R sendCode(@PathVariable(name = "mobile") String mobile) {
        return tbUserService.sendCode(mobile);
    }
    @PostMapping("/userNameLogin")
    public R userNameLogin(@RequestBody TbUser tbUser) {
        return tbUserService.userNameLogin(tbUser);
    }
    @PostMapping("/retrieveUserPass/{mobile}/{code}/{userPass}")
    public R retrieveUserPass(@PathVariable String mobile,@PathVariable String code,@PathVariable String userPass) {
        return tbUserService.retrieveUserPass(mobile,code,userPass);
    }
}
